var MsgDlg = (function(){
    function MsgDlg(content,type,_confirmHandler,_cancleHandler) {
        MsgDlg.super(this);
        this._confirmHandler = _confirmHandler;
        this._cancleHandler = _cancleHandler;
        this.content.text = content;
        this.bg.y = 400;
        if(type == "alert"){
            this.btnConfirm.visible = true;
            this.btnCancle.visible = false;
            this.btnConfirm.x = (this.bg.width - this.btnConfirm.width)/2
        }else{
            this.btnConfirm.visible = true;
            this.btnCancle.visible = true;
        }
        this.btnConfirm.on(Laya.Event.MOUSE_DOWN, this, this.confirmHandler);
        this.btnCancle.on(Laya.Event.MOUSE_DOWN, this, this.cancleHandler);

        this.popup(true);
    }
    Laya.class(MsgDlg, 'ui.msgDlg', MsgDlgUI);
    MsgDlg.prototype.confirmHandler = function() {
        if(this._confirmHandler){
            this._confirmHandler();
        }
        this.close();
    }
    MsgDlg.prototype.cancleHandler = function() {
        if(this._cancleHandler){
            this._cancleHandler();
        }
        this.close();
    }
    
    
    return MsgDlg;
})();